package com.itheima.appserver.service;
import com.itheima.appserver.config.MyThreadLocal;
import org.bson.types.ObjectId;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.commons.pojo.Album;
import com.itheima.dubbo.interfaces.AlbumApi;
import org.springframework.stereotype.Service;

/**
 * @ClassName: AblumService
 * @Description:
 * @Author: Administrator
 * @Date: 2021/12/8 10:49
 */
@Service
public class AlbumService {

    @Reference
    AlbumApi albumApi;

    public void save(String publishId) {
        Album ablum = new Album();

        ablum.setId(new ObjectId());
        ablum.setPublishId(new ObjectId(publishId));
        ablum.setCreated(System.currentTimeMillis());


        albumApi.savePublishid(ablum, MyThreadLocal.getUserId().toString());
    }


}
